package com.demo.springcloud.controller;

import com.demo.springcloud.pojo.CommonResult;
import com.demo.springcloud.pojo.Payment;
import com.demo.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenyuan
 * @date 2020/12/5 16:37
 */
@Slf4j
@RestController
@RequestMapping("/consumer")
public class OrderFeignController {
	@Autowired
	private PaymentFeignService feignService;

	@GetMapping("/getPaymentById/{id}")
	public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id) {
		return feignService.getPaymentById(id);
	}

	@GetMapping(value = "/payment/feign/timeout")
	public String paymentFeignTimeout() {
		return feignService.paymentFeignTimeout();
	}
}
